package com.smarttiger.zero.admin.entity;

import javax.persistence.*;
import java.util.List;

@Entity
@Table(name = "menu")
public class MenuModel extends BaseEntity {

    @Column(name = "name",length = 100)
    private String name;

    @Column(name = "path",length = 100)
    private String path;

    @Column(name = "icon",length = 50)
    private String icon;

    @Column(name = "parentId",length = 50)
    private String parentId;

    @OneToMany(cascade = CascadeType.ALL,fetch = FetchType.EAGER)
    @JoinColumn(name = "parentId", nullable = true)
    private List<MenuModel> menuModelList;

    public List<MenuModel> getMenuModelList() {
        return menuModelList;
    }

    public void setMenuModelList(List<MenuModel> menuModelList) {
        this.menuModelList = menuModelList;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPath() {
        return path;
    }

    public void setPath(String path) {
        this.path = path;
    }

    public String getParentId() {
        return parentId;
    }

    public void setParentId(String parentId) {
        this.parentId = parentId;
    }

    public String getIcon() {
        return icon;
    }

    public void setIcon(String icon) {
        this.icon = icon;
    }
}
